<template>
	<div>
	  <div style="background: #2180C1;">
	    <div class="flexc ww" style=" justify-content: flex-end;">
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZA1.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-KIDA1.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZA2.svg" style="width: 30px; height: 54px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-KIDA2.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZDO_B1.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZB1.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZB2.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZC1.svg" style="width: 30px; height: 30px;"></div>
	      <div style="margin-right: 15px;"><img src="../../static/img/icon-ZC2.svg" style="width: 30px; height: 30px;"></div>
	    </div>
	  </div>
	  <div class="ww" style="height: 160px;">
	    <div class="flexb">
	      <div style="background: #fff; position: relative; top: -80px;"><img src="../../static/img/logo.png" style="width: 220px; height: 220px; "></div>
	      <div style="padding-top: 20px;">

	        <div style="justify-content: end; margin-bottom: 20px; color: #999; cursor: pointer;" class="flexc" >
            <div class="flexc" @click="gerenzhongxin()" v-if="denglu">
              <i class="el-icon-user-solid" style="margin-right: 10px; color: #999;"></i>
              我的奥德
            </div>
            <div class="flexc" style="margin-left: 20px; color: #2180C1;" @click="tuichu()"  v-if="denglu">
              退出
            </div>


            <div class="flexc" v-if="!denglu">
              <i class="el-icon-user-solid" style="margin-right: 10px; color: #999;"></i>
              未登录
            </div>
            <div class="flexc" style="margin-left: 20px; color: #2180C1;" @click="denglugo()"  v-if="!denglu">
              登录
            </div>


	        </div>

	        <div class="flexc">
            <router-link to="/index" class="nav">首页</router-link>
            <router-link to="/kaoshi" class="nav">考试报名</router-link>
            <router-link to="/kaochang" class="nav">考试中心</router-link>
            <router-link to="/kaoguan" class="nav">考官介绍</router-link>
            <router-link to="/guanyuwomen" class="nav">关于我们</router-link>
	          <!-- <div class="nav">考试报名</div>
	          <div class="nav">考试中心</div>
	          <div class="nav">考官介绍</div>
	          <div class="nav">关于我们</div> -->
	        </div>
	      </div>
	    </div>
	  </div>
	</div>
</template>

<script>
	export default {
		name: 'top',
		data() {
			return {
        osd_person:JSON.parse(localStorage.getItem('osd_person')) || '',
        denglu:false
			}
		},
		created() {
      //判断用户是否登录的接口
      axios.post(this.IP_URL+'/user/getinfo').then((response)=>{
        if(response.data.errorcode == 0){
          this.denglu = true
        } else {
          // this.$message.error(response.data.reason);
        }
      })


		},
		mounted() {

		},
		methods: {
      tuichu:function(){
        axios.post(this.IP_URL+'/user/logout').then((response)=>{
          if(response.data.errorcode == 0){
            this.$message.success('已退出登录');
            this.reload()
          } else {
            this.$message.error(response.data.reason);
          }
        })
      },
      denglugo:function(){
        this.$router.push('/denglu')
      },
      gerenzhongxin:function(){

        this.$router.push('/gerenzhongxin')
      }
		}
	}
</script>


<style scoped lang="less">
  .nav{ margin-left: 50px; color: #0872BA; font-size: 18px; font-weight: bold; cursor: pointer;}
</style>
